#ifndef _NP_PROBLEMS_UTILS_HEADER_
#define _NP_PROBLEMS_UTILS_HEADER_

#include <vector>
#include <string>
#include <fstream>

namespace Library
{
    class Utils
    {
    public:
        static void ReadData(const std::string& path, std::vector<std::pair<double, double> >& points);
        static void CalculateDistances(const std::vector<std::pair<double, double> >& points, std::vector<std::vector<double> >& matrix);
        static void ChangeDistanceForOnePoint(const std::vector<std::pair<double, double> >& points, std::vector<std::vector<double> >& matrix, const int numberOfPoint);
        static void PrimeAlgorithm(const std::vector<std::vector<double> >& matrix, std::vector<std::pair<int, int> >& edges);
        static double CalculateLength(const std::vector<std::vector<double> >& matrix, const std::vector<std::pair<int, int> >& edges);


    protected:
        static double DistanceBitwen(std::pair<double, double> first, std::pair<double, double> second);
        static void InitializeSet(std::set<int>& setToInitialize, int numberOfPoints);
        static std::pair<int, int> FindTheBestEdgeToAdd(const std::vector<std::vector<double> >& matrix, std::set<int>& usedPoints, std::set<int>& unUsedPoints);
        static std::pair<int, int> FindTheSmallistEdgeAndInitializeSets(const std::vector<std::vector<double> >& matrix, std::set<int>& usedPoints, std::set<int>& unUsedPoints);
    };
}

#endif //_NP_PROBLEMS_UTILS_HEADER_